[type-declarations] Open isset check in StrictArrayParamDimFetchRectorTest, move to last position in type-declaration level#7388
Conversation
26d22aa to
f119912
Compare
|
I could not find this one, thanks I see lot of missed array types just to avoid string access. Will make this condition less strict to improve auto fill 👍 |
|
Then that's need on very last on level set list with Also, still needs |
5c1b4b8 to
a5d9773
Compare
a5d9773 to
b2dd4a7
Compare
…rTest, move to last position in type-declaration level
2bc2bc4 to
88a4185
Compare
|
|
||
| final class CoverIssetWithDimFetch | ||
| { | ||
| public function run(array $param, $item): bool |
There was a problem hiding this comment.
in this case $param could be anything which implements ArrayAccess not just the rare case of string-offset access.
in case you "wrongly guess" the array type a call with a ArrayAccess object will produce a fatal error at runtime - see https://3v4l.org/csROV
There was a problem hiding this comment.
Indeed, it's a choice of practice over risk of few edge cases. We apply same logic to other rules too, to ease manual daunting work on project upgrades.
If your codebase uses any type in this case, exclude the rule.
There was a problem hiding this comment.
Indeed, it's a choice of practice over risk of few edge cases. We apply same logic to other rules too, to ease manual daunting work on project upgrades.
If your codebase uses any type in this case, exclude the rule.
|
This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work. |
In one project I've noticed there is no
arrayfilled where obviously should be one.Single
issetmight be triggered on null and key, but maybe more useful cases are ignored then. Let's open up this a bit and test in the wild, if brings more value 👍